#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: bao
# @Date:   2017-01-16 11:59:29
# @Last Modified by:   bao
# @Last Modified time: 2017-04-17 22:04:03

from Unit import *


class Link:
    def __init__(self, linkId, linkCap=1.0 * Gb):
        # link ID is named as tuple of (start node id, destination node id)
        self.linkId = linkId

        # source Node Id
        self.srcID = 0

        # dest Node Id
        self.dstID = 0

        # link capacity
        self.linkCap = linkCap

        # link residual capacity
        self.residualCap = linkCap

        # Current Flow ids on this link
        self.flowIds = []

    def __repr__(self):
        return "link_id:{!r}, linkCap:{!r}, flowIds:{!r}".format(self.linkId, self.linkCap, self.flowIds)

    def __del__(self):
        pass
